import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), k = in.nextInt();
        PriorityQueue<Integer> heap = new PriorityQueue<>();
        for(int i=0;i<n;i++) {
            int x = in.nextInt();
            heap.add(x);
        }
        int sum = 0,ret = 0;
        while(true) {
            int t = heap.poll();
            sum += t;
            if(sum>=k) break;
            ret++;
            heap.add(t*2);
        }
        System.out.print(ret);
    }
}
//堆的应用（默认小根堆）